﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UPMS.Core.Domain;
using System.Data.Entity;

namespace UPMS.Core.Dao
{
    public class DepartmentDao : BaseDao<Department, Guid>
    {
        public override IList<Department> Select()
        {
            return Execute(ctx => ctx.Departments.Include(a => a.Orgaization).ToArray());
        }

        public Department Select(Guid id)
        {
            return Execute(ctx => ctx.Departments.Include(a => a.Orgaization).FirstOrDefault(a => a.Id == id));
        }
    }
}
